#!/usr/bin/python2.7.8
#encoding:utf-8

import pyshark

captures = pyshark.FileCapture("1.pcap")

list =''
for c in captures:
    for pkt in c:
        if pkt.layer_name == "icmp" :
            if pkt.type=='0':
                try:
                    print(pkt.code)
                    list+=pkt.code
                except:
                    continue
print(list)


